package nevo.pkgs.es;

import java.util.*;

import nevo.core.*;

public class ElitistSelector implements Selector
{
	public List<IRecord> select(List<IRecord> population, int size) throws Exception
	{
		List<IRecord> pcopy = new ArrayList<IRecord>(population.size());		
		Collections.sort(population, new IRecordComparator());
		
		for (int k = 0; k < size; k++) {
			pcopy.add(population.get(k));
		}
		return pcopy;
	}
	

}
